#ifndef _PLATE_H
#define _PLATE_H

#include <iostream>
#include <string.h>
#include <opencv/cv.hpp>

#define VIDEO_PATH "../video/video.avi"

extern cv::Mat frame_Buff, frame_HSV;

extern int id_base;

class LightBar
{
public:
    int id;
    cv::Point2f Top, Bottom, Center;
    double length;
    LightBar();
    LightBar(cv::Point2f _Top, cv::Point2f _Bottom);
    void _init_(cv::Point2f _Top, cv::Point2f _Bottom);
    double ranging(LightBar _Bar);
    bool judge(LightBar _Bar);
    bool empty = true;
private:
};

class ArmorPlate
{
public:
    ArmorPlate();
    ArmorPlate(LightBar _Bar_I, LightBar _Bar_II);
    void _init_(LightBar _Bar_I, LightBar _Bar_II);
    void print();
    cv::Point2f Center;
    cv::Point2f corner[4];//按顺序左上->右下 四个角点
    LightBar left_Bar, right_Bar;
    bool empty = true;
};

void get_Frame_Video(std::string fileName = VIDEO_PATH, int fps = 60);
void locate_Plate(cv::Mat hsv_img);

#endif
